﻿using System;

namespace ConsoleApp4
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.Write("请输入下限：");
            int lowerLimit = int.Parse(Console.ReadLine());
            Console.Write("请输入上限：");
            int upperLimit = int.Parse(Console.ReadLine());
            Console.WriteLine($"在{lowerLimit}到{upperLimit}之间的素数有：");
            int count = 0;
            for (int i = lowerLimit; i <= upperLimit; i++)
            {
                if (IsPrime(i))
                {
                    Console.Write(i + " ");
                    count++;
                    if (count % 10 == 0)
                    {
                        Console.WriteLine();
                    }
                }
            }
            Console.WriteLine();
        }
        static bool IsPrime(int number)
        {
            if (number < 2)
                return false;
            for (int i = 2; i <= Math.Sqrt(number); i++)
            {
                if (number % i == 0)
                    return false;
            }
            return true;
        }
    }
}